<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>{{ filename }}'s Coverage report</title>
    <link rel="icon" sizes="32x32" href="./template/search.ico">
    <link rel="stylesheet" href="./template/style.css" type="text/css">
    <script type="text/javascript" src="./template/jquery.min.js"></script>
    <script type="text/javascript" src="./template/jquery.ba-throttle-debounce.min.js"></script>
    <script type="text/javascript" src="./template/jquery.tablesorter.min.js"></script>
    <script type="text/javascript" src="./template/jquery.hotkeys.js"></script>
    <script type="text/javascript" src="./template/coverage_html.js"></script>
    <script type="text/javascript">
        jQuery(document).ready(coverage.index_ready);
    </script>
</head>
<body class="indexfile">
<div id="header">
    <div class="content">
        <h1>{{ filename }}覆盖率测试报告</h1>
    </div>
</div>
<div id="index">
    <table class="index", style="margin: auto;">
        <thead>
            <tr class="tablehead" title="Click to sort">
                <th class="name left headerSortDown shortkey_n">文件名</th>
                <th class="shortkey_s">代码行数</th>
                <th class="shortkey_x">非代码行数</th>
                <th class="shortkey_m">已执行行数</th>
                <th class="shortkey_x">未执行行数</th>
                <th class="right shortkey_c">覆盖率</th>
            </tr>
        </thead>
        <tbody>
            <tr class="file">
                <td class="name left"><a href="test_res.html">{{ filename }}</a></td>
                <td>{{ code_lines }}</td>
                <td>{{ blank_and_comment_lines }}</td>
                <td>{{ executed_lines }}</td>
                <td>{{ code_lines - executed_lines }}</td>
                <td class="right" data-ratio="21 46">{{ code_coverage_rate }}%</td>
            </tr>
        </tbody>
    </table>
    <p id="no_rows">
        No items found using the specified filter.
    </p>
    <hr/>
    <h2 style="font-weight: bold;">{{ filename }}代码：</h2>
    <div style="overflow: scroll; display: table; width: 90%;">
        <div style="display: table-cell; width: 92%">
            {% if tested_code %}
                {% for color, line_content, _ in tested_code %}
                    <p style="background-color: {{ color }}; white-space:pre;">{{ line_content }}</p>
                {% endfor %}
            {% endif %}
        </div>
        <div style="display: table-cell;">
            {% if tested_code %}
                {% for _, _, exec_times in tested_code %}
                    <p>&nbsp;执行次数：{{ exec_times }}</p>
                {% endfor %}
            {% endif %}
        </div>
    </div>
    <p style="white-space: pre;">
        <span style="color: rgb(14, 223, 14)">绿色</span>代表被执行代码行     <span style="color: rgb(240, 56, 56)">红色</span>代表未执行的代码     <span style="color: rgb(5, 67, 238)">蓝色</span>代表空行和注释行
    </p>
    <hr/>
    <h2 style="font-weight: bold;">程序执行路径：</h2>
    <div style="width: 90%; height: auto; line-height: 2.4; word-wrap: break-word; overflow: hidden;">
        {% if compressed_executed_sequence %}
            {% for lineno, executed_amount in compressed_executed_sequence %}
                <div style="display: inline; background-color: rgb(14, 223, 14)">(Line_{{ lineno }})</div>
                {% if executed_amount > 1 %}
                    <div style="display: inline; color: rgb(240, 56, 56)">×{{ executed_amount }}</div>
                {% endif %}
                <div style="display: inline"> -> </div>
            {% endfor %}
            <div style="display: inline; background-color: rgb(14, 223, 14)"> END </div>
        {% endif %}
    </div>
    <hr/>
    <h2 style="font-weight: bold;">条件分支部分：</h2>
    <div>
        {% if condition_info_list %}
            {% for code_block_list, start_lineno, end_lineno, else_lineno in condition_info_list %}
                <p>条件分支代码块({{ start_lineno }}行 ~ {{ end_lineno }}行)</p>
                {% if else_lineno != -1 %}
                    <p>分支(else/elif)开始行数：{{ else_lineno }}</p>
                {% endif %}
                <div style="overflow: scroll; width: 90%;">
                    {% for color_str, line_of_code, _ in code_block_list %}
                        <p style="background-color: {{ color_str }};white-space:pre;">{{ line_of_code }}</p>
                    {% endfor %}
                </div>
                <br/>
            {% endfor %}
        {% endif %}
    </div>
    <hr/>
    <h2 style="font-weight: bold;">循环部分：</h2>
    <div>
        {% if recurrent_info_list %}
            {% for code_block_list, start_lineno, end_lineno in recurrent_info_list %}
                <p>循环代码块({{ start_lineno }}行 ~ {{ end_lineno }}行)</p>
                <div style="overflow: scroll; width: 90%;">
                    {% for color_str, line_of_code, _ in code_block_list %}
                        <p style="background-color: {{ color_str }};white-space:pre;">{{ line_of_code }}</p>
                    {% endfor %}
                </div>
                <br/>
            {% endfor %}
        {% endif %}
    </div>
    <hr/>
    <h2 style="font-weight: bold;">被调用的函数(按先后顺序)：</h2>
    <div>
        {% if call_sequence %}
        <ol>    
            {% for lineno, func_name in call_sequence %}
                <li style="white-space:pre;">调用行数：{{ lineno }}     被调用函数名称：{{ func_name }}</li>
            {% endfor %}
        </ol>
        {% endif %}
    </div>
    <hr/>
    <h2 style="font-weight: bold;">异常捕捉情况：</h2>
    <div>
        {% if exception_info_sequence %}
            {% for exce_name, exce_value, lineno, func_name in exception_info_sequence %}
                <p style="white-space:pre;">* Tracing exception:</p>
                <p style="white-space:pre;">* {{ exce_name }} "{{ exce_value }}"</p>
                <p style="white-space:pre;">* on line {{ lineno }} of {{ func_name }}</p>
            {% endfor %}
        {% endif %}
    </div>
</div>
<div id="footer">
    <div class="content">
        <p>
            <a class="nav" href="">Forest's coverage tool</a>,
            created at {{ datetime_str }}
        </p>
        <br/>
    </div>
</div>
</body>
</html>
